package com.lsyw.intergrate.serviceImpl;

import cn.dev33.satoken.stp.StpUtil;
import com.lsyw.intergrate.common.Result;
import com.lsyw.intergrate.entity.Vehicle;
import com.lsyw.intergrate.mapper.VehicleMapper;
import com.lsyw.intergrate.service.VehicleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 车辆信息 服务实现类
 * </p>
 *
 * @author 刘磊
 * @since 2023-11-29
 */
@Service
public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> implements VehicleService {

    @Override
    public Result getVehicle() {
        String loginId = null;
        try {
            loginId = StpUtil.getLoginIdAsString();
        } catch (Exception e) {
            return new Result(4414, "登录过期，请重新登录", "登录过期，请重新登录");
        }
        return Result.successResult(baseMapper.getVehicle(loginId));
    }
}
